﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AppraisalManagement
{
    public partial class EmployeeKPILinking : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                EmpKPILinkingDataSetTableAdapters.Employee_KPI_LinkingTableAdapter empKPIAdap = new AppraisalManagement.EmpKPILinkingDataSetTableAdapters.Employee_KPI_LinkingTableAdapter();
                empKPIAdap.Insert(Int32.Parse(kPIGroupDropDown.SelectedValue.ToString()), Int32.Parse(KPIDropDown.SelectedValue.ToString()), Int32.Parse(txtMaxScore.Text.ToString()), Int32.Parse(EmpDropDownList.SelectedValue.ToString()), Int32.Parse(managerDropDown.SelectedValue.ToString()));

                KPIEmpLinkGridView.DataSourceID = "KPIEmpLinkDataSource";
            }
            catch{}
        }

        protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
        {
            int temp = 0;
            args.IsValid = Int32.TryParse(txtMaxScore.Text, out temp);
        }
    }
}
